<%@ page import="com.actimind.actitime.beans.UserBean,
                 com.actimind.actitime.Keys,
                 com.actimind.actitime.beans.CustomerBean,
                 com.actimind.actitime.util.Util,
                 org.apache.struts.util.ResponseUtils"%><%@ page errorPage="/error.jsp" %><%

UserBean loggedinUser = (UserBean)session.getAttribute(Keys.LOGGEDIN_USER_KEY);
CustomerBean customer = (CustomerBean)session.getAttribute(Keys.CUSTOMER_KEY);

if (loggedinUser == null)
{
    response.sendRedirect("../login.do");
}
else if (customer == null)
{
    response.sendRedirect("customerlist.do");
}
else
{
%>
<%@ taglib uri="/WEB-INF/at.tld" prefix="at" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
    <title><bean:write name="title-prefix" scope="application"/> View Customer Description</title>

    <link rel="stylesheet" href="../css/at.css" type="text/css">

</head>

<body bgcolor="#ffffff" topmargin="10" leftmargin="10" marginheight="0" marginwidth="0">

<logic:messagesPresent>
    <at:errors />
</logic:messagesPresent>
<logic:messagesNotPresent>

    <table cellspacing="0" cellpadding="5" align="center" valign="top" border="0" bgcolor="#ffffff" width="100%">
    <tr>
        <td class="pagetitle" colspan="2">
            View Customer Description
        </td>
    </tr>
    <tr>
        <td class="formbuttonpane" style="text-align:left">
            <span class="formblocktitle">Customer:</span>
        </td>
        <td class="formbuttonpane" style="text-align:left">
            <span class="textemphasis"><%=ResponseUtils.filter(customer.getName())%></span>
        </td>
    </tr>
    <tr>
        <td class="text" width="18%" nowrap="1">
            Billing Status:
        </td>
        <td class="text">
            <%=(customer.isBillingStatus() ? "Billable" : "Non-Billable")%>
        </td>
    </tr>
    <tr>
        <td class="text" width="18%" nowrap="1" valign="top" align="left">
            Customer Description:
        </td>
        <td class="text" valign="top" align="left">
            <%=Util.nl2br(ResponseUtils.filter(customer.getDescription()))%>
        </td>
    </tr>
    <tr>
        <td align="center" class="formbuttonpane" colspan="2">
            <a class="text" href="javascript: window.close()">Close window</a>
        </td>
    </tr>
    </table>

</logic:messagesNotPresent>

</body>
</html>
<%
}
%>